package tools

import (
	"crypto/md5"
	"encoding/hex"
	"fmt"
	"io"
	"time"
)

func GetTimestamp() int64 {
	return time.Now().Unix()
}

func Retrun_md5(s string) string {
	// md5加密
	h := md5.New()
	io.WriteString(h, s)
	md5_str := hex.EncodeToString(h.Sum(nil))
	return md5_str
}

func Retrun_md5_v2(s string) string {
	// md5加密
	data := []byte(s)
	md5_str := fmt.Sprintf("%x", md5.Sum(data))
	return md5_str
}
